package cn.sdormitory.controller.school;

import cn.sdormitory.common.api.CommonPage;
import cn.sdormitory.common.api.CommonResult;
import cn.sdormitory.school.entity.SchoolPatrolHandle;
import cn.sdormitory.school.service.SchoolPatrolHandleService;
import cn.sdormitory.school.vo.PatrolHandleQueryVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("school/patrol/handle")
public class SchoolPatrolHandleController {

    @Autowired
    SchoolPatrolHandleService schoolPatrolHandleService;

    @PostMapping("/findPageList")
    public CommonResult<CommonPage<SchoolPatrolHandle>> findSchoolPatrolHandlePageList(@RequestBody PatrolHandleQueryVo vo){
        IPage<SchoolPatrolHandle> pageList = schoolPatrolHandleService.findPageList(vo);
        return CommonResult.success(CommonPage.restPage(pageList));
    }

}
